<template>
  <div>
    <div>foo</div>
    <div>{{ $store.state.name }}</div>
  </div>
</template>
<script>
export default {
  asyncData(store) {
    console.log("进来了---------");
    return store.dispatch("changeName", "王五");
  },
  // 客户端才有的钩子
  mounted() {
    // this.$store.dispatch("changeName", "李四");
  },
};
</script>
<style  scoped>
div {
  color: red;
}
</style>
